import mitt from "mitt";
const emitter = mitt();
const eventBus = {
  // 短信设置完成
  analysisFinish: {
    emit: (e: any = '') => {
      emitter.emit('analysisFinish', e);
    },
    on: (callback: any = '') => {
      emitter.on('analysisFinish', (e) => callback(e));
    },
    off: () => {
      emitter.off('analysisFinish');
    }
  },
  // 伴奏支体编辑完成
  branchModifyFinish: {
    emit: (e: any = '') => {
      emitter.emit('branchModifyFinish', e);
    },
    on: (callback: any = '') => {
      emitter.on('branchModifyFinish', (e) => callback(e));
    },
    off: () => {
      emitter.off('branchModifyFinish');
    }
  },
  // 产品编辑完成
  productFinish: {
    emit: (e: any = '') => {
      emitter.emit('productFinish', e);
    },
    on: (callback: any = '') => {
      emitter.on('productFinish', (e) => callback(e));
    },
    off: () => {
      emitter.off('productFinish');
    }
  },
}
export default eventBus;